import { detailApi } from "@/api/detail";
// 详情模块
const detailModule = {
  namespaced: true,
  state: {
    // 详情数据
    detailInfo: {},
  },
  mutations: {
    getDetailData(state, payload) {
      state.detailInfo = payload.result;
    },
  },
  actions: {
    // 请求详情数据
    async asyncGetDetailData({ commit }, payload) {
      const res = await detailApi({ id: payload.id });
      commit("getDetailData", res);
    },
  },
};

export default detailModule;
